package com.javaweb.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.javaweb.admin.entity.KDLCustomer;
import com.javaweb.admin.entity.KDLCustomerLog;
import com.javaweb.admin.entity.KDLSupplier;
import com.javaweb.admin.entity.KDLSupplierLog;
import com.javaweb.admin.query.KDLCustomerQuery;
import com.javaweb.admin.query.KDLSupplierQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface KDLSupplierMapper extends BaseMapper<KDLSupplier> {
    IPage<KDLSupplier> getSupplierList(IPage<KDLSupplier> page, @Param("req") KDLSupplierQuery req);

    @Select("select * from v_kdl_supplierlist where ncts>=#{ncts}")
    List<KDLSupplier> GetNCSupplierList(String ncts);

    @Select("select isnull(convert(varchar(19),max(ncts),120),'') from kdl_supplier")
    String GetMaxNCTS();


    @Select("select * from kdl_supplier_log where suppliercode=#{suppliercode} order by ncts desc")
    List<KDLSupplierLog> GetNCSupplierLogList(String suppliercode);

    @Select("select distinct qcusername from kdl_supplier order by qcusername")
    List<String> getQCUserList();
}
